<template>
    <LineChart :xData="xData" :yData="yData"></LineChart>
</template>

<script>
import { ordertotaldataReq } from "../../api/home.api.js";
import LineChart from "../../components/Line/LineChart.vue";
export default {
  components: {
    LineChart
  },
  data() {
    return {
      xData: [],
      yData: []
    };
  },
  created() {
    ordertotaldataReq().then(res => {
      this.xData = res.data.xData;
      console.log(this.xData);

      this.yData = [
        {
          name: "销售量",
          data: res.data.amountData
        },
        {
          name: "订单量",
          data: res.data.orderData
        }
      ];
      console.log(this.amountData);
    });
  }
};
</script>

<style lang="less" scoped>
</style>